﻿
var client = new WindowsAzure.MobileServiceClient(                                              // construct an instance of the MobileServiceClient class, Azure Mobile Service
    "https://kpiapp.azure-mobile.net/",
    "jBAHqLXAGcycfSdgWKWBOXMkKryGXz12"
);


function LaunchPage(homeOrDetail) {                                                             //waits for device ready signal from phone, then waits for document ready
    this.homeOrDetail = homeOrDetail;                                                           //then launches content() function
    document.addEventListener("deviceready", $(document).ready(content(homeOrDetail)), false);  
}

function content(homeOrDetail) {

     if (homeOrDetail == 0) {                                                                    //if statement, 0 = index screen, int above 0 = detail screen where int is kpi id

         DisplayHome(homeOrDetail);
        }

     else if (homeOrDetail > 0) {

         DisplayDetails(homeOrDetail);

        }
}

